]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ui/main: Don't show welcome screen or root warning with perf tests
authorJonas Ådahl <jadahl@gmail.com>
Mon, 28 Nov 2022 15:44:18 +0000 (16:44 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Tue, 29 Nov 2022 16:48:20 +0000 (17:48 +0100)
If we want to run with the welcome screen showing, it should be done so
explicitly. Hide it if there is a perf test running for now, so that
what we test is what is expected to be tested.

We also don't want to show the root user warning, since we'll be running
as root in the CI containers.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2560>

js/ui/main.js

index 2d8804aca831bdab5f6f0c6f876c3722af6698d1..b6f54da9eb49247d6e273505e5a2635ef76a1090 100644 (file)
@@ -329,12 +329,16 @@ function _initializeUI() {
             });
         }
 
-        let credentials = new Gio.Credentials();
-        if (credentials.get_unix_user() === 0) {
-            notify(_('Logged in as a privileged user'),
-                   _('Running a session as a privileged user should be avoided for security reasons. If possible, you should log in as a normal user.'));
-        } else if (sessionMode.showWelcomeDialog) {
-            _handleShowWelcomeScreen();
+        const perfModuleName = GLib.getenv('SHELL_PERF_MODULE');
+        if (!perfModuleName) {
+            let credentials = new Gio.Credentials();
+            if (credentials.get_unix_user() === 0) {
+                notify(
+                    _('Logged in as a privileged user'),
+                    _('Running a session as a privileged user should be avoided for security reasons. If possible, you should log in as a normal user.'));
+            } else if (sessionMode.showWelcomeDialog) {
+                _handleShowWelcomeScreen();
+            }
         }
 
         if (sessionMode.currentMode !== 'gdm' &&
@@ -343,7 +347,6 @@ function _initializeUI() {
 
         LoginManager.registerSessionWithGDM();
 
-        let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
         if (perfModuleName) {
             let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
             let module = eval(`imports.perf.${perfModuleName};`);